#pragma once

#include <QDialog>
#include <QVBoxLayout>

class DarkTitleBar;
class DarkTitleDialog : public QDialog
{
    Q_OBJECT
public:
    DarkTitleDialog(QWidget* p=0);
    ~DarkTitleDialog();

    void addWidgetContent(QWidget* p);

    void setMainWindowMode();

protected:
    QVBoxLayout* layeout;
    QVBoxLayout* contentLayeout;
    DarkTitleBar* pTitleBar{0};
};

#define DARK_EXEC \
    protected: \
        DarkTitleDialog* _parentDialog{ 0 };\
    public:\
        int exec() override {\
            if (!_parentDialog) {\
                _parentDialog = new DarkTitleDialog();\
                _parentDialog->addWidgetContent(this);\
            }\
            setVisible(true);\
            return _parentDialog->exec();\
        }
